import httpRequest from '@/utils/request'

// 获取角色管理的数据
export const getRoleListAPI = ({ page, pagesize }) => httpRequest({ url: `/sys/role?page=${page}&pagesize=${pagesize}` })

// 获取角色管理的数据
export const postRoleAPI = (data) => httpRequest({ url: `/sys/role`, method: 'POST', data })

// 更新角色管理的数据
export const putRoleAPI = (data) => httpRequest({ url: `/sys/role/${data.id}`, method: 'PUT', data })

// 删除角色管理的数据
export const delRoleAPI = (id) => httpRequest({ url: `/sys/role/${id}`, method: 'DELETE' })

// 获取角色详情
export const getRoleDetailsAPI = (id) => httpRequest({ url: `/sys/role/${id}` })

// 分配角色权限
export const putPermissionRoleAPI = (data) => httpRequest({ url: `/sys/role/assignPrem`, method: 'PUT', data })

